<template>
  <page-meta :root-font-size="fontsize" style="display: block">
    <div class="certification">
      <xlNavBar :isShare="isShare" title="平台资质" :isMark="true" bgc="ff9d49"></xlNavBar>
      <div class="container">
        <div class="item" @click="preview(0)">
          <div class="left">ICP备案证书</div>
          <div class="right iconfont cyjiantouyou"></div>
        </div>
        <div class="item" @click="preview(1)">
          <div class="left">ICP增值业务许可证</div>
          <div class="right iconfont cyjiantouyou"></div>
        </div>
        <div class="item" @click="preview(2)">
          <div class="left">互联网备案信息</div>
          <div class="right iconfont cyjiantouyou"></div>
        </div>
        <div class="item" @click="preview(3)">
          <div class="left">人力资源许可证</div>
          <div class="right iconfont cyjiantouyou"></div>
        </div>
        <div class="page_bottom_ptzz">
          <text class="t1">有疑问？</text>
          <text class="t2" @click="lxkf">联系餐饮信息网客服~</text>
        </div>
      </div>
      <cyxxwkfPopup @close="close" title="餐饮信息网客服" cancelText="复制微信号" submitText="拨打电话" :show="showIosPopup"></cyxxwkfPopup>
    </div>
  </page-meta>
</template>

<script>
import config from "@/config.js";
import cyxxwkfPopup from "@/pages3/compontents/cyxxwkfPopup.vue";
export default {
  name: "certification",
  components: { cyxxwkfPopup },
  data() {
    return {
      isShare: 0,
      fontsize: "",
      showIosPopup: false,
      imageList: [
        "https://chenxiao.obs.cn-north-1.myhuaweicloud.com/img/13_1680317108023808159.Y05c4vsUL60Of4b90c8098debebac53cdd0033bb6987.png",
        "https://chenxiao.obs.cn-north-1.myhuaweicloud.com/img/13_1680317129959551561.zJUydODTp6818bf76fd20657c81ce7d923e82c08f374.png",
        "https://chenxiao.obs.cn-north-1.myhuaweicloud.com/img/13_1680317146834341129.uTz7LcxG2AA0be17911dbc7d49ac73587bf39170f7c3.png",
        "https://chenxiao.obs.cn-north-1.myhuaweicloud.com/img/13_1680317164118246217.ADgRul7U9JE6fcdd496475188e41fa4a73cc4e4fcef3.png",
      ],
    };
  },
  methods: {
    preview(index) {
      uni.previewImage({
        current: index,
        urls: this.imageList,
      });
    },
    lxkf() {
      this.showIosPopup = true;
    },
    close() {
      uni.setClipboardData(
        {
          data: config.kfwxh, //要被复制的内容
          success: () => {
            //复制成功的回调函数
            uni.showToast({
              //提示
              title: `微信号复制成功`,
              icon: "success",
            });
          },
        },
        true
      );

      this.showIosPopup = false;
    },
  },
  onLoad(options) {
    if (options.params) {
      let params = JSON.parse(decodeURIComponent(options.params));
      if (params.shareUserId) {
        this.$setStoraged("shareUserId", params.shareUserId);
        this.isShare = 1;
      }
    }
    let designWidth = 37.5; //因设计图的宽度
    let that = this;
    //窗体改变大小触发事件
    uni.onWindowResize(res => {
      console.log("变化后的窗口宽度=", res.size.windowWidth);
      //100*屏幕宽度/设计稿宽度
      that.fontsize = Math.floor((1.5 * res.size.windowWidth) / designWidth) + "px";
      console.log("字体大小：", that.fontsize);
    });

    //打开获取屏幕大小
    uni.getSystemInfo({
      success(res) {
        console.log("设备信息：", res);
        that.fontsize = Math.floor((1.5 * res.screenWidth) / designWidth) + "px";
        console.log("字体大小：", that.fontsize);
      },
    });
  },
};
</script>

<style lang="scss" scoped>
.certification {
  background: #f7f7f7;
  .container {
    background: #f7f7f7;
    height: 100vh;
    .item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      height: 50px;
      background: #ffffff;
      border-radius: 8px 8px 8px 8px;
      margin: 15px auto;
      box-sizing: border-box;
      padding: 0 15px;
      .left {
        font-size: 16px;
        font-family: PingFang SC-Semibold, PingFang SC;
        font-weight: 600;
        color: #333333;
      }
      .right {
        color: #707070;
      }
    }
  }
  .page_bottom_ptzz {
    text-align: center;
    font-size: 12px;
    font-family: PingFang SC-Medium, PingFang SC;
    font-weight: 400;
    color: #999999;
    .t2 {
      color: #ff8822;
    }
  }
}
</style>
